{% load firecares_tags %}

<div class="ct-pagination text-center">
    <ul class="pagination">
    {% if first_page %}
            <li><a href="?{% url_replace request 'page' first_page %}{{ url_postfix }}" title="First page" aria-label="First page"><i class="fa fa-angle-double-left"></i></span></a></li>
    {% endif %}

    {% if page_obj.has_previous %}
            <li><a href="?{% url_replace request 'page' page_obj.previous_page_number %}{{ url_postfix }}" title="Previous page" aria-label="Previous page"><span aria-hidden="true"><i class="fa fa-angle-left"></i></span></a></li>
    {% endif %}

        {% for p in windowed_range %}
            {% if p != page_obj.number %}
                 <li><a href="?{% url_replace request 'page' p %}{{ url_postfix }}" title="Page {{ p }} of {{ page_obj.paginator.num_pages}}" aria-label=title="Page {{ p }} of {{ page_obj.paginator.num_pages}}">{{ p }}</a></li>
            {% else %}
                 <li class="active"><a href="?{% url_replace request 'page' p %}{{ url_postfix }}" title="Page {{ p }} of {{ page_obj.paginator.num_pages}}" aria-label=title="Page {{ p }} of {{ page_obj.paginator.num_pages}}">{{ p }}</a></li>
            {% endif %}
        {% endfor %}

    {% if page_obj.has_next %}
            <li><a href="?{% url_replace request 'page' page_obj.next_page_number %}{{ url_postfix }}" title="Next page" aria-label="Next page"><span aria-hidden="true"><i class="fa fa-angle-right"></i></span></a></li>
    {% endif %}

    {% if last_page %}
            <li><a href="?{% url_replace request 'page' last_page %}{{ url_postfix }}" title="Last page" aria-label="Last page"><i class="fa fa-angle-double-right"></i></span></a></li>
    {% endif %}
    </ul>
</div>
